<!DOCTYPE html>
<html class="has-navbar-fixed-top">
<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
<title>Deploy Test - HANZO</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.css">


<meta name="description" content="鬼王, HANZO, THRAEX">



<meta name="keywords" content="鬼王, O70, HANZO, THRAEX">



    <meta name="description" content="Deploy Test1234$ scp -r hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework .$ scp hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework/esp-gateway/target/gateway-0.">
<meta name="keywords" content="鬼王, O70, HANZO, THRAEX">
<meta property="og:type" content="article">
<meta property="og:title" content="Deploy Test">
<meta property="og:url" content="http://yoursite.com/documents/others/deploy-test.html">
<meta property="og:site_name" content="HANZO">
<meta property="og:description" content="Deploy Test1234$ scp -r hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework .$ scp hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework/esp-gateway/target/gateway-0.">
<meta property="og:locale" content="en">
<meta property="og:updated_time" content="2019-07-26T04:02:09.397Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Deploy Test">
<meta name="twitter:description" content="Deploy Test1234$ scp -r hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework .$ scp hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework/esp-gateway/target/gateway-0.">





<link rel="icon" href="/images/favicon.ico">


<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Ovo|Source+Code+Pro">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css">


<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/lightgallery/1.6.8/css/lightgallery.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/justifiedGallery/3.6.5/css/justifiedGallery.min.css">


<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">

<link rel="stylesheet" href="/css/style.css">

<script defer src="//use.fontawesome.com/releases/v5.0.8/js/all.js"></script>



</head>
<body>
    
<nav class="navbar is-transparent is-fixed-top navbar-main" role="navigation" aria-label="main navigation">
    <div class="container">
        <div class="navbar-brand">
            <a class="navbar-item navbar-logo" href="/">
                
                    
                    HANZO
                    
                
            </a>
            <div class="navbar-burger">
                <span></span>
                <span></span>
                <span></span>
            </div>
        </div>
        
        <div class="navbar-menu navbar-start">
            
            <a class="navbar-item " href="/categories/Technology">Technology</a>
            
            <a class="navbar-item " href="/categories/Life">Life</a>
            
            <a class="navbar-item " href="/archives">Archives</a>
            
            <a class="navbar-item " href="/about">About</a>
            
            <a class="navbar-item " href="/main">Main</a>
            
        </div>
        
        <div class="navbar-menu navbar-end">
            
            <a class="navbar-item search" title="Search" href="javascript:;">
                <i class="fas fa-search"></i>
            </a>
            
            
            
            <a class="navbar-item" title="GitHub" href="https://github.com/O70">
                
                <i class="fab fa-github"></i>
                
            </a>
               
            
        </div>
    </div>
</nav>

    <section class="section">
    <div class="container">
    <article class="article content gallery" itemscope="" itemprop="blogPost">
    <h1 class="article-title is-size-3 is-size-4-mobile" itemprop="name">
        
            Deploy Test
        
    </h1>
    <div class="article-meta columns is-variable is-1 is-multiline is-mobile is-size-7-mobile">
        <span class="column is-narrow">
            <time datetime="2018-10-21T01:00:00.000Z" itemprop="datePublished">Oct 21 2018</time>
        </span>
        
        
        <span class="column is-narrow">
            
            
            3 minutes read (About 392 words)
        </span>
        
    </div>
    <div class="article-entry is-size-6-mobile" itemprop="articleBody">
    
        <h1 id="Deploy-Test"><a href="#Deploy-Test" class="headerlink" title="Deploy Test"></a>Deploy Test</h1><figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ scp -r hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework .</span><br><span class="line">$ scp hanzo@10.122.22.115:/home/hanzo/Workspace/MicroServices/esp-framework/esp-gateway/target/gateway-0.0.1-SNAPSHOT.jar .</span><br><span class="line"></span><br><span class="line">$ scp guiwang@10.122.x.x:common.jar .</span><br></pre></td></tr></table></figure>
<h2 id="Runing-Mode"><a href="#Runing-Mode" class="headerlink" title="Runing Mode"></a>Runing Mode</h2><ul>
<li><p><code>maven</code></p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ mvn spring-boot:run \</span><br><span class="line">  -DCFG_CONFIG_HOST=10.122.22.115 \</span><br><span class="line">  -Deureka.client.serviceUrl.defaultZone=http://10.122.22.115:8761/eureka</span><br></pre></td></tr></table></figure>
</li>
<li><p><code>java</code></p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ java -jar gateway-0.0.1-SNAPSHOT.jar \</span><br><span class="line">  --CFG_CONFIG_HOST=10.122.22.115 \</span><br><span class="line">  --eureka.client.serviceUrl.defaultZone=http://10.122.22.115:8761/eureka</span><br></pre></td></tr></table></figure>
</li>
<li><p><code>docker</code></p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">$ mvn clean package -Dmaven.test.skip=<span class="hljs-literal">true</span> docker:build</span><br><span class="line"></span><br><span class="line">$ docker run -d --name esp-registry -p 8761:8761 10.122.22.115:5000/esp-registry</span><br><span class="line"></span><br><span class="line">$ docker run -d --name esp-config -p 8750:8750 \</span><br><span class="line">  -e CFG_EUREKA_HOST=10.122.22.115 \</span><br><span class="line">  10.122.22.115:5000/esp-config \</span><br><span class="line">  ; docker logs -f esp-gateway</span><br><span class="line"></span><br><span class="line">$ docker run -d --name esp-gateway -p 8765:8765 \</span><br><span class="line">  -e CFG_CONFIG_HOST=10.122.22.115 \</span><br><span class="line">  -e SPRING_CLOUD_CONFIG_LABEL=env \</span><br><span class="line">  10.122.22.115:5000/esp-gateway \</span><br><span class="line">  ; docker logs -f esp-gateway</span><br><span class="line"></span><br><span class="line">$ docker run -d --name esp-admin -p 8085:8085 \</span><br><span class="line">  -e CFG_CONFIG_HOST=10.122.22.115 \</span><br><span class="line">  -e SPRING_CLOUD_CONFIG_LABEL=env \</span><br><span class="line">  10.122.22.115:5000/esp-admin \</span><br><span class="line">  ; docker logs -f esp-admin</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h2 id="Docker-Command"><a href="#Docker-Command" class="headerlink" title="Docker Command"></a>Docker Command</h2><ul>
<li><p>Create tag</p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">$ docker tag 10.122.22.115:5000/esp-registry 10.122.22.115:5000/esp-registry</span><br><span class="line">$ docker tag 10.122.22.115:5000/esp-config 10.122.22.115:5000/esp-config</span><br><span class="line">$ docker tag 10.122.22.115:5000/esp-gateway 10.122.22.115:5000/esp-gateway</span><br><span class="line">$ docker tag 10.122.22.115:5000/esp-admin10.122.22.115:5000/esp-admin</span><br></pre></td></tr></table></figure>
</li>
<li><p>Remove container</p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$ docker rm -v $(docker stop esp-registry)</span><br><span class="line">$ docker rm -v $(docker stop esp-config)</span><br><span class="line">$ docker rm -v $(docker stop esp-gateway)</span><br><span class="line">$ docker rm -v $(docker stop esp-admin)</span><br><span class="line"><span class="hljs-comment">#! or</span></span><br><span class="line">$ docker ps -a --filter <span class="hljs-string">"name=esp-*"</span></span><br><span class="line">$ docker rm -v $(docker ps -a --filter <span class="hljs-string">"name=esp-*"</span> -q)</span><br></pre></td></tr></table></figure>
</li>
<li><p>Remove image</p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ docker images -f <span class="hljs-string">"reference=10.122.22.115:5000/esp-*"</span></span><br><span class="line"></span><br><span class="line">$ docker rmi $(docker images 10.122.22.115:5000/* -q)</span><br><span class="line"><span class="hljs-comment">#! or</span></span><br><span class="line">$ docker rmi -f $(docker images -f <span class="hljs-string">"reference=10.122.22.115:5000/esp-*"</span> -q)</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h2 id="Docker-Settings"><a href="#Docker-Settings" class="headerlink" title="Docker Settings"></a>Docker Settings</h2><ul>
<li><p>/etc/systemd/system/docker.service.d/http-proxy.conf</p>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[Service]</span><br><span class="line">Environment=&quot;HTTP_PROXY=http://proxy1.bj.petrochina:8080&quot;</span><br><span class="line">Environment=&quot;HTTPS_PROXY=http://proxy1.bj.petrochina:8080&quot; &quot;NO_PROXY=localhost, 127.0.0.1, 10.27.213.66, 10.27.213.69, 10.122.22.115&quot;</span><br></pre></td></tr></table></figure>
</li>
<li><p>/etc/docker/daemon.json</p>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  &quot;registry-mirrors&quot;: [&quot;https://ik8akj45.mirror.aliyuncs.com&quot;],</span><br><span class="line">  &quot;insecure-registries&quot;: [&quot;10.27.213.66:5000&quot;, &quot;10.122.22.115:5000&quot;]</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>/var/lib/docker/containers/CONTAINER_ID/hostconfig.json</p>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"># update port mapping</span><br><span class="line">&#123;</span><br><span class="line">  ...</span><br><span class="line">  &quot;PortBindings&quot;:&#123;&quot;5000/tcp&quot;:[&#123;&quot;HostIp&quot;:&quot;&quot;,&quot;HostPort&quot;:&quot;5000&quot;&#125;]&#125;</span><br><span class="line">  ...</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>http: server gave HTTP response to HTTPS client</p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">$ vim /etc/docker/daemon.json</span><br><span class="line">&#123;</span><br><span class="line">  <span class="hljs-string">"insecure-registries"</span>:[<span class="hljs-string">"10.122.22.115:5000"</span>]</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">$ sudo systemctl daemon-reload</span><br><span class="line">$ sudo systemctl restart docker</span><br></pre></td></tr></table></figure>
</li>
<li><p>net/http: request canceled (Client.Timeout exceeded while awaiting headers)</p>
<figure class="highlight sh hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">$ vim /etc/docker/daemon.json</span><br><span class="line">&#123;</span><br><span class="line">  <span class="hljs-string">"registry-mirrors"</span>: [<span class="hljs-string">"https://ik8akj45.mirror.aliyuncs.com"</span>]</span><br><span class="line">  <span class="hljs-comment"># "registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
<li><p>On Windows10</p>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  &quot;registry-mirrors&quot;: [</span><br><span class="line">    &quot;https://ik8akj45.mirror.aliyuncs.com&quot;</span><br><span class="line">  ],</span><br><span class="line">  &quot;insecure-registries&quot;: [</span><br><span class="line">    &quot;10.122.163.216:5000&quot;</span><br><span class="line">  ],</span><br><span class="line">  &quot;debug&quot;: true,</span><br><span class="line">  &quot;experimental&quot;: false</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h2 id="Questions"><a href="#Questions" class="headerlink" title="Questions"></a>Questions</h2><ul>
<li>spring.cloud.client.ip-address[10.27.213.167/172.16.81.167]</li>
<li>spring.cloud.client.ip-address[10.27.213.167/172.16.81.167]</li>
</ul>

    
    </div>
    
    
    <div class="columns is-mobile is-multiline article-nav">
        <span class="column is-12-mobile is-half-desktop  article-nav-prev">
            
            <a href="/documents/Technology/Git/github-gitee-pages-hexo.html">GitHub/Gitee Pages + Hexo</a>
            
        </span>
        <span class="column is-12-mobile is-half-desktop  article-nav-next">
            
            <a href="/documents/others/docker-run-image.html">Docker Run Image</a>
            
        </span>
    </div>
    
</article>





    </div>
</section>
    <footer class="footer">
    <div class="container">
        <div class="columns content">
            <div class="column is-narrow has-text-centered">
                Copyright &copy; 2019 鬼王&nbsp;
                <!-- Powered by <a href="https://github.com/O70" target="_blank">O70</a> -->
            </div>
            <div class="column is-hidden-mobile"></div>

            
            <div class="column is-narrow">
                <div class="columns is-mobile is-multiline is-centered">
                
                    
                <a class="column is-narrow has-text-black" title="京ICP备19029828号" href="http://www.miitbeian.gov.cn">
                    
                    京ICP备19029828号
                    
                </a>
                
                    
                <a class="column is-narrow has-text-black" title="GitHub" href="https://github.com/O70">
                    
                    GitHub
                    
                </a>
                
                </div>
            </div>
            
            

        </div>
    </div>
</footer>

    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment-with-locales.min.js"></script>

<!-- test if the browser is outdated -->
<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/outdated-browser/1.1.5/outdatedbrowser.min.js"></script>
<script>
    $(document).ready(function () {
        // plugin function, place inside DOM ready function
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        })
    });
</script>

<script>
    window.FontAwesomeConfig = {
        searchPseudoElements: true
    }
    moment.locale("en-AU");
</script>



<script src="/js/script.js"></script>


    
    <div class="searchbox ins-search">
    <div class="searchbox-mask"></div>
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="Type something...">
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js"></script>
    
</body>
</html>
